/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package persistencia;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author aridrobo
 */
@Entity
@Table(name = "Departamento")
@NamedQueries({
    @NamedQuery(name = "Departamento.findAll", query = "SELECT d FROM Departamento d"),
    @NamedQuery(name = "Departamento.findByIdDpto", query = "SELECT d FROM Departamento d WHERE d.idDpto = :idDpto"),
    @NamedQuery(name = "Departamento.findByNomDepto", query = "SELECT d FROM Departamento d WHERE d.nomDepto = :nomDepto"),
    @NamedQuery(name = "Departamento.findByIdDirector", query = "SELECT d FROM Departamento d WHERE d.idDirector = :idDirector"),
    @NamedQuery(name = "Departamento.findByTelfDpto", query = "SELECT d FROM Departamento d WHERE d.telfDpto = :telfDpto"),
    @NamedQuery(name = "Departamento.findByDescripcion", query = "SELECT d FROM Departamento d WHERE d.descripcion = :descripcion")})
public class Departamento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idDpto", nullable = false)
    private Integer idDpto;
    @Basic(optional = false)
    @Column(name = "nomDepto", nullable = false, length = 30)
    private String nomDepto;
    @Basic(optional = false)
    @Column(name = "idDirector", nullable = false)
    private int idDirector;
    @Column(name = "telfDpto", length = 7)
    private String telfDpto;
    @Column(name = "descripcion", length = 300)
    private String descripcion;

    public Departamento() {
    }

    public Departamento(Integer idDpto) {
        this.idDpto = idDpto;
    }

    public Departamento(Integer idDpto, String nomDepto, String telfDpto, String descripcion,  int idDirector) {
        this.idDpto = idDpto;
        this.nomDepto = nomDepto;
        this.idDirector = idDirector;
        this.telfDpto = telfDpto;
        this.descripcion = descripcion;
    }

    public Integer getIdDpto() {
        return idDpto;
    }

    public void setIdDpto(Integer idDpto) {
        this.idDpto = idDpto;
    }

    public String getNomDepto() {
        return nomDepto;
    }

    public void setNomDepto(String nomDepto) {
        this.nomDepto = nomDepto;
    }

    public int getIdDirector() {
        return idDirector;
    }

    public void setIdDirector(int idDirector) {
        this.idDirector = idDirector;
    }

    public String getTelfDpto() {
        return telfDpto;
    }

    public void setTelfDpto(String telfDpto) {
        this.telfDpto = telfDpto;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDpto != null ? idDpto.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Departamento)) {
            return false;
        }
        Departamento other = (Departamento) object;
        if ((this.idDpto == null && other.idDpto != null) || (this.idDpto != null && !this.idDpto.equals(other.idDpto))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "persistencia.Departamento[idDpto=" + idDpto + "]";
    }

}
